/* CalcTask.cs - Berechnungs-Input-Daten - Beschreibt den Task
 * Copyright (C) 2009 Dietmar Schinnerl
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
 */

using System;
using System.Collections.Generic;

namespace App.Net
{
    public class CalcTask {
	    public Task Task;
	    public int RemainingHours;
	    public DateTime EndDate;
	    public int Priority;
	    public List<CalcPredecessor> CalcPredecessorList = new List<CalcPredecessor>();	
	    public List<CalcSkilledWorker> CalcSkilledWorkerList = new List<CalcSkilledWorker>();
	    public DateTime BestEndDate;
	    public int BestError;
	    public int Error;
	    public CalcTask FinishWithCalcTask;

	    public int Percentage(){
            return (Task.EstimatedHours - RemainingHours) * 100 / Task.EstimatedHours;
	    }

	    public int CompareTo(object otherObject)
        {
            CalcTask otherCalcTask = otherObject as CalcTask;
            if (otherCalcTask != null)
            {
                return otherCalcTask.BestError.CompareTo(BestError);
            }
            
            throw new ArgumentException("object is not a CalcTask");    
        }
    }//end CalcTask
}









































































